<template>
  <ElInputNumber style="width: 100%" v-model="formModel[widget.id]" v-bind="getElProps"> </ElInputNumber>
</template>
<script setup lang="ts" name="NumberWidget">
import { ElInputNumber } from "element-plus";
import { computed } from "vue";
import { omit } from "lodash";
const props = defineProps({
  widget: {
    type: Object
  },
  formModel: {
    type: Object
  }
});
const getElProps = computed(() => {
  const elProps = props.widget!.elProps;
  if (elProps.min === null && elProps.max === null) {
    return omit(elProps, "min", "max");
  } else if (elProps.min === null) {
    return omit(elProps, "min");
  } else if (elProps.max === null) {
    return omit(elProps, "max");
  } else {
    return elProps;
  }
});
</script>
<style lang="scss" scoped></style>
